// HttpClient.h: interface for the CHttpClient class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_HTTPCLIENT_H__4950B66D_7095_4A03_903A_D8F252ED55F0__INCLUDED_)
#define AFX_HTTPCLIENT_H__4950B66D_7095_4A03_903A_D8F252ED55F0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//#include "lclog.h"
#include <memory>
#include <windows.h>
#include <wininet.h>
#define HTTP_DEF_XMLACCEPT TEXT("accept-language: zh-cn\r\n")\
	TEXT("x-prototype-version: 1.4.0\r\n")\
	TEXT("referer: %s\r\n")\
	TEXT("x-requested-with: XMLHttpRequest\r\n")\
TEXT("content-type: application/x-www-form-urlencoded")
#define HTTP_DEF_HTTPACCEPT TEXT("*/*")

class CHttpClient  
{
public:
	HINTERNET   m_hSession;
	HINTERNET   m_hConnection;
	TCHAR m_lasturl[1024];
	CHttpClient();
	virtual ~CHttpClient();
	int Get(TCHAR * pServerName,TCHAR * pUrlPath,TCHAR * pLocatePath);
	int Post(TCHAR * pServerName,TCHAR * pUrlPath,TCHAR * pLocatePath,TCHAR *pParm);
	int Posts(TCHAR * pServerName,TCHAR * pUrlPath,TCHAR * pLocatePath,TCHAR *pParm);
	int OpenUrl(TCHAR * purl,TCHAR * pLocatePath);
	int GetMem(TCHAR * pServerName,TCHAR * pUrlPath,TCHAR * pLocatePath);
	int PostMem(TCHAR * pServerName,TCHAR * pUrlPath,TCHAR *pParm,TCHAR * buffer,int &bufferlen);
	int PostsMem(TCHAR * pServerName,TCHAR * pUrlPath,TCHAR * pLocatePath,TCHAR *pParm);
	int OpenUrlMem(TCHAR * purl,TCHAR * buffer,int &bufferlen);
	int SetReferer(TCHAR * pReferer);
};

#endif // !defined(AFX_HTTPCLIENT_H__4950B66D_7095_4A03_903A_D8F252ED55F0__INCLUDED_)





















